<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>采购单管理下的采购单维护</title>
    <style type="text/css">
        td{
            height: 25px;
            width: 100px;
            border: #3a8ee6 1px solid;

        }
        input{
            height: 21px;
        }
    </style>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="../../js/jquery-1.11.0.min.js"></script>
    <script type="text/javascript" src="../../js/bootstrap.min.js"></script>
    <script type="text/javascript" src="../../js/02/drugb/cengci.js"></script>
    <script type="text/javascript" src="../../js/02/purchaseMent/num01.js"></script>
    <script type="text/javascript" src="../../js/02/purchaseMent/yeshu1.js"></script>
    <script type="text/javascript" src="../../js/02/purchaseMent/add.js"></script>
    <script type="text/javascript">
        gets()

        function undata(aa) {
            var a =aa;
            alert(a)

            $.ajax({
                url: '/myspringboot/purchasement/findById',
                type: 'post',
                dataType: "json",
                data:{
                    id:a,
                },
                success:function(result){
                    var list = result.data;
                    alert(list)
                    console.log(list);
            for (i=0;i<list.length;i++) {
                        alert(list[i])
                //var hname = list[i].hospital.hName;
                var lianxiren = list[i].poContacts;
                var poName = list[i].poName;
                var poPhone = list[i].poPhone;
                var poRemarks = list[i].poRemarks;
                var poSubmissionTime = list[i].poSubmissionTime;
                $("#yiyuan1").val(poName);
                $("#yiyuan2").val(a);
                $("#lianxiren1").val(lianxiren);
                $("#caigoudanmingcheng1").val(poName);
                $("#lianxifangshi1").val(poPhone);
                $("#beizhu1").val(poRemarks);
                $("#gonghuo1").val(poSubmissionTime);

            }
                }
            })

        }
    </script>
</head>
<body>
<div>
    <table class="" style="border: 1px solid #999;border-collapse:collapse">
        <tr>
            <h3 style="height: 50px" >采购单查询</h3>
        </tr>
        <tr>
            <td>采购单编号号：</td>
            <td><input id="dinumber" name="dinumber" type="text" value=""></td>
            <td></td>
            <td>采购单名称：</td>
            <td><input id="cname" name="cname" type="text" value=""></td>
            <td></td>
        </tr>
        <tr>
            <td>采购单状态：</td>
            <td>
                <select id="cengci" style=" height: 25px; width: 160px;">
                <option value="">全部</option>

            </select>
            </td>
            <td></td>
            <td>采购时间：</td>
            <td><input id="lefPprice" style="width: 65px" type="text" value="">至<input id="rightPrice" style="width: 65px" type="text" value=""></td>
            <td></td>
        </tr>
        <tr>
            <td>医院名称：</td>
            <td><input id="hospital" type="text" value=""></td>
            <td></td>
        </tr>


    </table>
    <td>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <button type="reset"  onclick="gets()">查询</button>
        <br>
        <button  data-toggle="modal" data-target="#myModal">添加采购单</button>
    </td>
    <table>
        <tr>
            <td>医院名称</td>
            <td>采购单编号</td>
            <td>采购单名称</td>
            <td>开始时间</td>
            <td>结束时间</td>
            <td>建单时间</td>
            <td>提交时间</td>
            <td>审核时间</td>
            <td>采购单状态</td>
            <td>查看</td>
            <td>修改</td>
            <td>删除</td>
        </tr>
        <tbody class="a">
        </tbody>
    </table>

</div>
<div class="im-page" id="impage">
    <tr>
        <td><button id='first'>首页</button></td>
        <td><button id='before'>上一页</button></td>
        <td>第<span id="pnum"></span>页</td>
        <td>共<span id="ptotal"></span>页</td>
        <td><button  id='next'>下一页</button></td>
        <td><button id='last'>尾页</button></td>
    </tr>
</div>
<!-- 模态框（Modal） -->
<from id="addfrom">
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    采购单添加
                </h4>
            </div>
            <div class="modal-body">
                <table>
                    <tr>
                        <td> 医院: <input type="text" id="yiyuan" name="01"></td>
                        <td> 联系人:<input type="text" id="lianxiren" name="02"></td>
                        <td> 采购单名称:<input type="text" id="caigoudanmingcheng" name="03"></td>
                    </tr>
                    <tr>
                        <td> 联系方式: <input type="text" id="lianxifangshi" name="04"></td>
                        <td>    备注: <input type="text" id="beizhu" name="05"></td>
                        <td> 供货时间: <input type="text" id="gonghuo" name="06"></td>
                    </tr>
                </table>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal" onclick="add()">保存采购单
                </button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>

<!--修改数据-->
    <div class="modal fade" id="xiugai" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="myModalxiugai">
                        采购单添加
                    </h4>
                </div>
                <div class="modal-body">
                    <table>
                        <tr>
                            <td> 医院: <input type="text" id="yiyuan1" name="01" value=""><input type="hidden" id="yiyuan2" value=""></td>
                            <td> 联系人:<input type="text" id="lianxiren1" name="02" value=""></td>
                            <td> 采购单名称:<input type="text" id="caigoudanmingcheng1" name="03" value=""></td>
                        </tr>
                        <tr>
                            <td> 联系方式: <input type="text" id="lianxifangshi1" name="04" value=""></td>
                            <td>    备注: <input type="text" id="beizhu1" name="05" value=""></td>
                            <td> 供货时间: <input type="text" id="gonghuo1" name="06" value=""></td>
                        </tr>
                    </table>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal" onclick="addd()">保存采购单
                    </button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
</from>
</body>
</html>
